package com.example.properties;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 配置资源 读取以 demo 开头的配置文件
 * 
 * @author lli
 *
 * @version 1.0
 *
 */
@Component
@ConfigurationProperties(prefix = "demo")
public class DemoProperties {

    private int id;
    /**
     * 在配置文件中可以配置数组
     */
    private List<String> servers;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public List<String> getServers() {
        return servers;
    }

    public void setServers(List<String> servers) {
        this.servers = servers;
    }

    @Override
    public String toString() {
        return "DemoProperties [id=" + id + ", servers=" + servers + "]";
    }

}